import React from 'react';
import { Tabs } from 'antd';
import type { TabsProps } from 'antd';
import HealthRecords from './HealthRecords/HealthRecords';
import HealthDatas from './HealthDatas/HealthDatas';
import Subscription from './Subscription/Subscription';
import ServiceRecord from './ServiceRecord/ServiceRecord';
import "./ResidentDetail.scss"
import { useSelector } from 'react-redux';
interface Props { }
function ResidentDetail(props: Props) {
    let residentId = useSelector((state: any) => { return state.WTreducer.residentId })
    // console.log(residentId);

    const onChange = (key: string) => {
        // console.log(key);
    };

    const items: TabsProps['items'] = [
        {
            key: '1',
            label: `健康档案`,
            children: <HealthDatas residentId={residentId} />,
        },
        {
            key: '2',
            label: `健康记录`,
            children: <HealthRecords residentId={residentId} />,
        },
        {
            key: '3',
            label: `签约信息`,
            children: <Subscription residentId={residentId} />,
        },
        {
            key: '4',
            label: `服务记录`,
            children: <ServiceRecord residentId={residentId} />,
        },
    ];
    return (
        <div className='residentdetail'>
            <div className='title'>居民详情</div>
            <Tabs defaultActiveKey="1" items={items} onChange={onChange} />
        </div>
    );
}

export default ResidentDetail;
